package com.tairanchina.wiki.api.model.wiki.navigation;

import java.net.URI;

/**
 * Created by 周靖捷 on 2016/10/1.
 */
public class ProjectSubNavigationElement implements NavigationElement {
    String title;
    URI linkedResource;

    public String getTitle() {
        return title;
    }

    public ProjectSubNavigationElement setTitle(String title) {
        this.title = title;
        return this;
    }

    public URI getLinkedResource() {
        return linkedResource;
    }

    public ProjectSubNavigationElement setLinkedResource(URI linkedResource) {
        this.linkedResource = linkedResource;
        return this;
    }

    @Override
    public String toMarkdown() {
        StringBuffer sb = new StringBuffer("  * ");
        sb.append("[").append(title==null?"":title).append("]").append("(").append(linkedResource==null?"":linkedResource.toString()).append(")");
        return sb.toString();
    }
}
